package com.chaoyer.cynet.common.exception;

import com.chaoyer.cynet.common.domain.ErrorInfo;

/**
 * Author : 李文超
 * Email : 1159849884@qq.com
 * Time : 2017/9/8 10:24
 **/
public class CyNetException extends RuntimeException {

    private long code;

    private String msg;

    private ErrorInfo errorInfo;

    public CyNetException(ErrorInfo errorInfo) {
        super(errorInfo.getMsg());
        this.code = errorInfo.getCode();
        this.msg = errorInfo.getMsg();
        this.errorInfo = errorInfo;
    }

    public CyNetException(String message, Throwable cause) {
        super(message, cause);
    }

    public long getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public void setCode(long code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public ErrorInfo getErrorInfo() {
        return errorInfo;
    }

    public void setErrorInfo(ErrorInfo errorInfo) {
        this.errorInfo = errorInfo;
    }
}
